What is a public id?

A Public ID, also known as a public identifier, is a globally unique name used to identify a resource, particularly in the context of markup languages like DTD or XML.

  • Purpose: The main purpose of a Public ID is to allow software to locate and use a specific resource, such as a Document Type Definition (DTD), even if the system identifier (a URL or file path) is unavailable or has changed. It provides a level of indirection and stability.

  • Structure: A Public ID generally follows a specific format, often including a registered owner ID and a specific name for the resource.

  • System Identifier Relationship: While the Public ID identifies the resource abstractly, the System Identifier (e.g., a URL) provides the concrete location where the resource can be found. A parser typically attempts to resolve the Public ID to a System Identifier using a catalog or resolver.